package com.santiao.fuel.ui.activity

import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.santiao.fuel.R
import com.santiao.fuel.bean.InnerBean
import com.santiao.fuel.databinding.ActivityGasPriceContentsBinding
import com.santiao.fuel.ui.adapter.RvGouNeiGasPriceAdaper

import com.santiao.fuel.utils.DisplayUtil
import com.santiao.publics.ui.SettingFragment

class Gas_price_contents : AppCompatActivity() {


    val binding: ActivityGasPriceContentsBinding by lazy {
        ActivityGasPriceContentsBinding.inflate(layoutInflater);
    }

    var gnDataset = mutableListOf<InnerBean>(
        InnerBean("江苏如东", "5750", "1405"),
        InnerBean("广汇启东", "5950", "1413"),
        InnerBean("福建莆田/莆田", "5350", "-"),
        InnerBean("福建莆田/浙南", "5040", "-"),
        InnerBean("福建莆田/江西", "5040", "-"),
        InnerBean("福建莆田/两湖", "5250", "1352"),
        InnerBean("深圳大鹏", "5650", "1350"),
        InnerBean("东莞九丰", "5700", "-"),
        InnerBean("广西北海", "5200", "1355"),
        InnerBean("浙江宁波基准价", "5350", "-"),
        InnerBean("国家管网天津", "4820", "-"),
        InnerBean("大连", "4350", "1450"),
    )


    var factoryPrice = mutableListOf<InnerBean>(
        InnerBean("东北/汽润能源", "5750", "1405"),
        InnerBean("东北/大庆庆然", "5950", "1413"),
        InnerBean("华北/宏基亿泰*", "5350", "-"),
        InnerBean("华北/内蒙时泰*", "5040", "-"),
        InnerBean("华北/内蒙兴洁", "5400", "1480"),
        InnerBean("华北/星星能源", "5440", "1400"),
        InnerBean("华北/正泰易达", "4210", "1444"),
        InnerBean("华北/山西华港*", "4380", "4380"),
        InnerBean("华北/国新运城*", "4450", "4450"),
        InnerBean("华北/国新临汾*", "4230", "4230"),
        InnerBean("华北/国新寿阳*", "4260", "4260"),
        InnerBean("华北/国新襄垣*", "4400", "4400"),
        InnerBean("华北/国新大同*", "4305", "4305"),
        InnerBean("华北/国新阳泉*", "4310", "4310"),
        InnerBean("华北/易高*", "4270", "4270"),
        InnerBean("西北/新沃达", "4800", "4800"),
        InnerBean("西北/圆恒能源", "4240", "4240"),
        InnerBean("西北/陕燃杨凌*", "4600", "4600"),
        InnerBean("西北/绿源子洲*", "4670", "4670"),
        InnerBean("广西北海", "5200", "1355"),
        InnerBean("浙江宁波基准价", "5350", "-"),
        InnerBean("国家管网天津", "4820", "-"),
        InnerBean("大连", "4350", "1450"),
        InnerBean("东莞九丰", "5700", "-"),
        InnerBean("福建莆田/江西", "5040", "-"),
        InnerBean("福建莆田/两湖", "5250", "1352"),
        InnerBean("深圳大鹏", "5650", "1350"),
    )


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        DisplayUtil.initActionBar(this)
        initData();
        initView();
        setContentView(binding.root)

        SettingFragment.adLoad(1, null, binding.flContent1, this, this)
    }

    /**
     * 初始化UI
     */
    private fun initView() {
        binding.itRow1.root.setBackgroundResource(R.drawable.table_bg_1)
        binding.factoryPriceTableHeard.rowName.setText("生产企业")
        binding.factoryPriceTableHeard.root.setBackgroundResource(R.drawable.table_bg_2)
        binding.gnPriceTableHeard.root.setBackgroundResource(R.drawable.table_bg_2)

        binding.itRow2.rowName.setText("中国LNG出厂价格")
        binding.itRow2.rowUnit.setText("4549")
        binding.itRow3.rowName.setText("中国LNG出站价格")
        binding.itRow3.rowUnit.setText("4801")
        binding.pageBack.setOnClickListener {
            finish();
        }
        binding.rvGnList.adapter = RvGouNeiGasPriceAdaper(this, gnDataset);
        binding.rvGpList.adapter = RvGouNeiGasPriceAdaper(this,factoryPrice)
    }


    /**
     * 初始化数据
     */
    private fun initData() {


    }

    // 返回
    fun back(view: View) {
        finish();
    }
}